home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Game-Power
/
Amiga Game-Power.iso
/
pd mix ii
/
access
/
hddriver
/
support
/
readdisk.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-20
|
868b
|
37 lines
#include <stdio.h>
#include "hd.h"
char buf[ HD_SECTOR ];
main ()
{
struct posn posn;
int status;
if ( wd_open () != 0 ) {
printf ( "wd_open() failed\n" );
exit ( 1 );
}
for ( posn.cylinder = 0; posn.cylinder < first.cylinders; posn.cylinder++ ) {
printf ( "%03ld " , posn.cylinder );
fflush ( stdout );
for ( posn.surface = 0; posn.surface < first.heads; posn.surface++ ) {
for ( posn.sector = 0; posn.sector < first.sectors; posn.sector++ ) {
posn.block = posn.sector
+ ( posn.surface * first.sectors )
+ ( posn.cylinder * first.sectors * first.heads );
if ( ( status = read_sector ( &posn , buf ) ) != 0 ) {
printf ( "\nread error: block %3ld cylinder %3ld surface %ld sector %2ld status %02x\n" ,
posn.block , posn.cylinder , posn.surface ,
posn.sector , status );
}
}
}
}
wd_close ();
}